home *** CD-ROM | disk | FTP | other *** search
-
-
- POWER BASIC LISTINGS
-
- Two file-types exist in the LEARNBAS folder:
-
- .BA - Power BASIC demo version
- .BAS - Power BASIC full version
-
-
- Boot up your Power BASIC select LOAD from the FILE menu, insert Cover
- Disk 5, click on the icon in the top left of the File-Select box
- and then double click on one of the BA/BAS files when they appear.
- That's it. The files will load; you may then run them or alter them.
-
- The following files complement the LEARN BASIC article in the magazine.
-
-
- TELEPHONE.BAS
-
- This program demonstrates the use of arrays to store and retrieve
- information. You can enter up to ten names and addresses and recall
- the phone numbers in any order by searching for the corresponding
- name. It also shows use of the INSTR function to search for a given
- string of characters anywhere within another string.
-
- The arrays are set up with BASIC's DIM statement and then
- each cell within the array can be addressed by quoting its co-
- ordinates.
-
-
- PHONEDAT.BAS
-
- This program is an extension of the TELEPHON.BAS program which stores
- and retrieves names and telephone numbers typed in from the keyboard.
- PHONEDAT.BAS loads the information into the array from DATA statements
- at the end of the file. This means that you no longer have to enter
- the information each time you run the program, but can let the program
- do it automatically. You can, of course, change the names and numbers
- within the DATA statement to make them more relevant to you, and
- extend the program by enlarging the dimensions of the array and
- increasing the number of items in the DATA line. Make sure that the
- number of elements in one dimension of the array is at least as large
- as the number of names in the DATA statements, and that if the data
- item includes spaces, it is enclosed in inverted commas (").
-
- A single, two dimensional array is used to hold the
- information, as this makes it easier to tie the name to its
- corresponding telephone number.
-
-
-